<?php

$config['role_privileges'] = array(
    /* 国内商标代理人组 */
    ROLE_TRADEMARK_AGENT => array(
        'trademark_list',
        'trademark_view',
        'client_list',
        'client_view',
        'partner_list',
        'partner_view',
        'foreign_list',
        'foreign_view',
    ),
    
    /* 国内商标流程组 */
    ROLE_TRADEMARK_FLOW => array(
        'trademark_list',
        'trademark_create',
        'trademark_update',
        'trademark_view',
        'client_list',
        'client_create',
        'client_update',
        'client_view',
        'partner_list',
        'partner_create',
        'partner_update',
        'partner_view',
    ),
    
    /* 专利代理人组 */
    ROLE_PATENT_AGENT => array(
//        'patent_list',
//        'patent_view',
        'client_list',
        'client_view',
        'partner_list',
        'partner_view',
        'foreign_list',
        'foreign_view',
    ),
    
    /* 专利流程组 */
    ROLE_PATENT_FLOW => array(
//        'patent_list',
//        'patent_create',
//        'patent_update',
//        'patent_view',
        'client_list',
        'client_create',
        'client_update',
        'client_view',
        'partner_list',
        'partner_create',
        'partner_update',
        'partner_view',
    ),
    
    /* 涉外事务组 */
    ROLE_FOREIGN_RELATED => array(
        'foreign_list',
        'foreign_create',
        'foreign_update',
        'foreign_view',
        'client_list',
        'client_create',
        'client_update',
        'client_view',
        'partner_list',
        'partner_create',
        'partner_update',
        'partner_view',
    ),
    
    /* 财务组 */
    ROLE_FINANCE => array(
        'trademark_list',
        'trademark_update',
        'trademark_view',
//        'patent_list',
//        'patent_update',
//        'patent_view',
        'foreign_list',
        'foreign_update',
        'foreign_view',
    ),
    
    /* 管理员组 */
    ROLE_ADMINISTRATOR => array(
        'all'
    )
);

/**
 * 权限对应控制器和方法
 */
$config['privilege_actions'] = array(
    /* 申请人 */
    'client_list' => array(
        'client' => array('index')
    ),
    'client_create' => array(
        'client' => array('create')
    ),
    'client_update' => array(
        'client' => array('update')
    ),
    'client_view' => array(
        'client' => array('view')
    ),
    
    /* 合作所 */
    'partner_list' => array(
        'partner' => array('index')
    ),
    'partner_create' => array(
        'partner' => array('create')
    ),
    'partner_update' => array(
        'partner' => array('update')
    ),
    'partner_view' => array(
        'partner' => array('view')
    ),

    /* 国内商标 */ 
    'trademark_list' => array(
        'trademark' => array('index','export')
    ),
    'trademark_view' => array(
        'trademark' => array('view')
    ),
    'trademark_create' => array(
        'trademark' => array('create', 'get_dynamic_info', 'get_client', 'get_partner')
    ),
    'trademark_update' => array(
        'trademark' => array('update', 'get_dynamic_info', 'get_client', 'get_partner')
    ),
    
    /* TODO:专利 */
    
    /* TODO:涉外业务 */
    'foreign_list' => array(
        'foreign' => array('index','export')
    ),
    'foreign_view' => array(
        'foreign' => array('view')
    ),
    'foreign_create' => array(
        'foreign' => array('create', 'get_dynamic_info'),
        'trademark' => array('get_client', 'get_partner'),
    ),
    'foreign_update' => array(
        'foreign' => array('update', 'get_dynamic_info'),
        'trademark' => array('get_client', 'get_partner'),
    ),
    
    
);